<me:UIAM x:Class="WPFExcelReport.TKSAM02"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL"   
                    xmlns:LS="clr-namespace:WPFExcelReport;assembly=TLIEFDAT"   
                    xmlns:DR="clr-namespace:WPFExcelReport;assembly=TDRAUFTR"   
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:WH="clr-namespace:WPFExcelReport;assembly=TLAGPL"  
                    xmlns:KS="clr-namespace:WPFExcelReport;assembly=TKSTSTELL"  
                    xmlns:AMD="clr-namespace:WPFExcelReport;assembly=TAMMODUL"           
                    xmlns:AME="clr-namespace:WPFExcelReport;assembly=TAMEINST" 
                    xmlns:AE="clr-namespace:WPFExcelReport;assembly=TMEKOPF" 
                    xmlns:WF="clr-namespace:WPFExcelReport;assembly=TICC_WFEVENTS" 
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIAM.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTBoolToVisibilityConverter  x:Key="nbv"/>
        <ucd:NOTConverter x:Key="not"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:SDKEYCONV x:Key="sd"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIAM.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition> 
        </Grid.RowDefinitions> 
        <StackPanel Grid.Row="0" Grid.Column="0"  >
            <WrapPanel Visibility="Collapsed">
                <Button Click="ResetSeq" Content="{Binding Source={Localization:Translate Word=重置序列号}}"
                    Visibility="{Binding IsITX,Converter={StaticResource bv}}"/> 
            </WrapPanel>
            <WrapPanel   >  

                <TextBlock   Text="{Binding Source={Localization:Translate Word=成本中心}}"/>
                <ex:TXT72 Grid.Column="1"  MaxLength="2"  PRE="  " 
                              CharacterCasing="Upper" Text="{Binding KRS,ElementName=TV}" Width="30" />
                <ex:TXT72 Grid.Column="2"  Margin="5,0,0,0" MaxLength="4"  
                          PRE="0000"
                              Text="{Binding LFD,ElementName=TV}" KeyUp="Query_KeyUp" Width="60" /> 

                <Button Grid.Column="0"  Click="QueryCommand" Height="20" Margin="5,0,0,0" Width="24" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                    </Button.Background>
                </Button>
                 <WF:TBTNEXE DLL="TAMSTAMM" CMD="AM02" STWNW="MainWindow" INFO="设备管理" 
                            KEY="{Binding KEY,ElementName=TV}"/>
            </WrapPanel> 
            <me:TAM04 x:Name="cAM04"
                      ORDERNUM="{Binding KEY,ElementName=TV}"
                      KEY="{Binding ORDERNUM,ElementName=TV}"
                      IsEdit="{Binding IsEdit,ElementName=TV}"
                      IsSaved="{Binding IsSaved,ElementName=TV}"
                      />
        </StackPanel>
        <DataGrid  Grid.Row="1"  Grid.Column="0" 
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   IsReadOnly="True"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"     
                   ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster"  
                   RowDetailsVisibilityMode="Visible"  
                    >
            <DataGrid.Columns>
                <DataGridTextColumn  Binding="{Binding AMNRKRS}"  />
                <DataGridTextColumn Binding="{Binding Path=AMLFDNR}" Header="{Binding Source={Localization:Translate Word=设备}}" Width="Auto"  />
                <DataGridTextColumn Binding="{Binding AMPOS}" Width="Auto"/>
                <DataGridTextColumn  Binding="{Binding AMBEZ,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=说明}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=AMHERST}" Header="{Binding Source={Localization:Translate Word=制造商}}" Width="Auto"  />
                <DataGridTextColumn Binding="{Binding Path=AMTYP,Converter={StaticResource sd},ConverterParameter=0228}" Header="{Binding Source={Localization:Translate Word=型号}}" Width="Auto"  />
                <DataGridTextColumn Binding="{Binding Path=AMART,Converter={StaticResource sd},ConverterParameter=0224}" Header="{Binding Source={Localization:Translate Word=类型}}" Width="Auto"  />
                <DataGridTextColumn Binding="{Binding Path=AMKSTKRS}"  Width="Auto"  />
                <DataGridTextColumn Binding="{Binding Path=AMLO}" Header="{Binding Source={Localization:Translate Word=LO}}" Width="Auto"  />
                <DataGridTextColumn Binding="{Binding Path=AMLB}" Header="{Binding Source={Localization:Translate Word=LB}}" Width="Auto"  />
                <DataGridTextColumn Binding="{Binding Path=AMLPLATZ}" Header="{Binding Source={Localization:Translate Word=LP}}" Width="Auto"  />
            </DataGrid.Columns>
        </DataGrid  > 
    </Grid>
</me:UIAM>
